From 316af7fb4eb33c6dd0a2dc05efaf7c7b16098013 Mon Sep 17 00:00:00 2001 From: "awilliam@xenbuild.aw" Date: Thu, 30 Nov 2006 15:57:20 -0700 Subject: [PATCH] [IA64] Update PV-on-HVM to follow status of interrupt controller Follow-on to xen-unstable cangeset: http://xenbits.xensource.com/xen-unstable.hg?cs=fe5ed694b0c2 - Follow to change a method of interrupt handling in latest changeset. - Modify to change the spec of callback IRQ in hypervisor side. - Modify to follow status of interrupt mask register of virtual interupt controller. - Modify to deliver interupts to a CPU specified with virtual interrupt controller. http://lists.xensource.com/archives/html/xen-ia64-devel/2006-11/msg00159.html Signed-off-by: Tsunehisa Doi Signed-off-by: Kouya SHIMURA --- xen/arch/ia64/vmx/vlsapic.c | 10 ++++++++-- xen/arch/ia64/vmx/vmx_process.c | 12 ++++++------ 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/xen/arch/ia64/vmx/vlsapic.c b/xen/arch/ia64/vmx/vlsapic.c index d2963fdf91..2fa0245099 100644 --- a/xen/arch/ia64/vmx/vlsapic.c +++ b/xen/arch/ia64/vmx/vlsapic.c @@ -103,8 +103,10 @@ static int vmx_vcpu_unpend_interrupt(VCPU *vcpu, uint8_t vector) ret = test_and_clear_bit(vector, &VCPU(vcpu, irr[0])); local_irq_restore(spsr); - if (ret) + if (ret) { vcpu->arch.irq_new_pending = 1; + wmb(); + } return ret; } @@ -488,8 +490,10 @@ int vmx_vcpu_pend_interrupt(VCPU *vcpu, uint8_t vector) ret = test_and_set_bit(vector, &VCPU(vcpu, irr[0])); local_irq_restore(spsr); - if (!ret) + if (!ret) { vcpu->arch.irq_new_pending = 1; + wmb(); + } return ret; } @@ -511,6 +515,7 @@ void vmx_vcpu_pend_batch_interrupt(VCPU *vcpu, u64 *pend_irr) } local_irq_restore(spsr); vcpu->arch.irq_new_pending = 1; + wmb(); } /* @@ -572,6 +577,7 @@ void guest_write_eoi(VCPU *vcpu) VLSAPIC_INSVC(vcpu,vec>>6) &= ~(1UL <<(vec&63)); VCPU(vcpu, eoi)=0; // overwrite the data vcpu->arch.irq_new_pending=1; + wmb(); } int is_unmasked_irq(VCPU *vcpu) diff --git a/xen/arch/ia64/vmx/vmx_process.c b/xen/arch/ia64/vmx/vmx_process.c index 3526175cbd..d6c5c295d1 100644 --- a/xen/arch/ia64/vmx/vmx_process.c +++ b/xen/arch/ia64/vmx/vmx_process.c @@ -225,15 +225,15 @@ void leave_hypervisor_tail(struct pt_regs *regs) if (v->vcpu_id == 0) { int callback_irq = d->arch.hvm_domain.params[HVM_PARAM_CALLBACK_IRQ]; - if (callback_irq != 0 && local_events_need_delivery()) { - /*inject para-device call back irq*/ - v->vcpu_info->evtchn_upcall_mask = 1; - vmx_vcpu_pend_interrupt(v, callback_irq); + if (callback_irq != 0) { + /* change level for para-device callback irq */ + vmx_vioapic_set_irq(d, callback_irq, + local_events_need_delivery()); } } - if ( v->arch.irq_new_pending ) { - v->arch.irq_new_pending = 0; + rmb(); + if (xchg(&v->arch.irq_new_pending, 0)) { v->arch.irq_new_condition = 0; vmx_check_pending_irq(v); return; -- 2.30.2